/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package testapplication.sprite;


import java.lang.reflect.Constructor;

import rawengine.graphics.Texture;
import rawengine.math.Vector2f;
import rawengine.tilegame.sprite.Sprite;

/**
    A PowerUp class is a Sprite that the player can pick up.
*/
public abstract class PowerUp extends Sprite {

    public PowerUp(String name, Texture image, Vector2f boundsCollision)
    {
        super(name, image, boundsCollision);
    }


    @SuppressWarnings("rawtypes")
	@Override
    public Object clone() {
        // use reflection to create the correct subclass
        Constructor constructor = getClass().getConstructors()[0];
        try {
            return constructor.newInstance(
                new Object[] {getName(), getImage(), boundsCollision});
        }
        catch (Exception ex) {
            // should never happen
            ex.printStackTrace();
            return null;
        }
    }


    /**
        A Star PowerUp. Gives the player points.
    */
    public static class Star extends PowerUp {
        public Star(String name, Texture image, Vector2f boundsCollision)
        {
            super(name, image, boundsCollision);
        }

		@Override
		public void wakeUp() {
			// TODO Auto-generated method stub
			
		}

		@Override
		public boolean isAlive() {
			// TODO Auto-generated method stub
			return true;
		}
    }


    /**
        A Music PowerUp. Changes the game music.
    */
    public static class Music extends PowerUp {
        public Music(String name, Texture image, Vector2f boundsCollision)
        {
            super(name, image, boundsCollision);
        }

		@Override
		public void wakeUp() {
			// TODO Auto-generated method stub
			
		}

		@Override
		public boolean isAlive() {
			// TODO Auto-generated method stub
			return true;
		}
    }


    /**
        A Goal PowerUp. Advances to the next map.
    */
    public static class Goal extends PowerUp {
        public Goal(String name, Texture image, Vector2f boundsCollision)
        {
            super(name, image, boundsCollision);
        }

		@Override
		public void wakeUp() {
			// TODO Auto-generated method stub
			
		}

		@Override
		public boolean isAlive() {
			// TODO Auto-generated method stub
			return true;
		}
    }

}
